//
//  NativeBleChannel.h
//  kq_flutter_core_widget
//
//  Created by wtb on 2024/1/26.
//

#import <CoreBluetooth/CoreBluetooth.h>
#import <Foundation/Foundation.h>
#import <Flutter/Flutter.h>
#import "NativeBleConnectStateChannel.h"
#import "NativeBleNotifyDataChannel.h"
#import "NativeBleEnableChannel.h"
#import "NativeBleScanChannel.h"

NS_ASSUME_NONNULL_BEGIN

@interface NativeBleChannel : NSObject
<
FlutterPlugin,
CBCentralManagerDelegate,
CBPeripheralDelegate>
//蓝牙管理对象
@property(nonatomic,strong) CBCentralManager *manager;
//存储蓝牙对象
@property(nonatomic,strong) NSMutableDictionary *peripherals;
//当前要连接蓝牙对象
@property(nonatomic,strong) CBPeripheral *__nullable peripheral;
//要连接的蓝牙服务
@property(nonatomic,copy) NSString *service;
//要连接的蓝牙特征值
@property(nonatomic,copy) NSString *character;
//查找的蓝牙
@property(nonatomic,copy) NSString *__nullable name;
//蓝牙是否打开
@property(nonatomic,assign) BOOL isOpen;
//是否还在扫描
@property(nonatomic,assign) BOOL isScaning;
//是否还在连接
@property(nonatomic,assign) BOOL isConnecting;
//回调
@property(nonatomic,copy) void (^flutterResult)(id _Nullable result);

//标识
@property(nonatomic,copy) NSString *tag;

//蓝牙状态通道对象
@property(nonatomic,strong) NativeBleConnectStateChannel *stateChannel;

//蓝牙开关通道对象
@property(nonatomic,strong) NativeBleEnableChannel *enableChannel;

//蓝牙扫描结果通道对象
@property(nonatomic,strong) NativeBleScanChannel *scanChannel;

//蓝牙接收数据通道对象
@property(nonatomic,strong) NativeBleNotifyDataChannel *dataChannel;
@end

NS_ASSUME_NONNULL_END
